package cc.chengheng.security.springmvc.init;

import cc.chengheng.security.springmvc.config.ApplicationController;
import cc.chengheng.security.springmvc.config.WebConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class SpringApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    /**
     * spring容器,相当于加载applicationContext.xml
     * @return
     */
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[] {
                ApplicationController.class
        };
    }

    /**
     * spring容器,相当于加载springmvc.xml
     * @return
     */
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] {
                WebConfig.class
        };
    }

    /**
     * 相当于url-mapping
     * @return
     */
    @Override
    protected String[] getServletMappings() {
        return new String[]{
                "/"
        };
    }
}
